<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><%--jstl을 쓰기 위해 사용 --%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %><%--숫자 포맷을 사용하기 위해 사용 --%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions"  prefix="fn"%><%--함수들을 이용하기 위해 사용 --%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<!--<script type="text/javascript" src="script/sms_riskI_script.js"></script>-->
</head>
<body>
<div class="box">
      		<h4 class="white">
      			<span class="align-left">위험식별</span>
      			
      			<span class="align-left red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      			평가를 다 마치신 후 마감을 하시기 바랍니다.
      			</span>
      			
      			<span class="align-left">
      				<a onclick="openMagam(2)" class="button3"><span>마감</span></a>
      			</span>
      			
	      		<span class="align-right">마감상태(위험식별) :
		      		<c:choose>
		      			<c:when test="${sessionScope.magamSession[2].state =='Y'}">
		      				 마감
		      			</c:when>
		      			<c:otherwise>
		      				 착수
		      			</c:otherwise>
		      		</c:choose>
	      		</span>
      		</h4>
        <div class="box-container1">     		
        
        	<table class="table-long">
      			<tfoot>
      				<tr>
      					<td>
      						<%--
      						<div class="align-left">&nbsp;&nbsp;
      						<a href="#" class="button1"><span>보안등급</span></a>&nbsp;&nbsp;
      							<!-- 보안등급 -->
								<select name="ascu_id" id="ascu_id" class="selectBox" onchange="search_mridenty();" style="width: 80px;">
									<c:choose>
										<c:when test="${fn:length(requestScope.ascuList)== 0}">
											<option selected="selected" value="0">0등급</option>
										</c:when>
										<c:otherwise>
											<c:forEach  var="ascuList" items="${requestScope.ascuList}" varStatus="status">
											<option <c:if test="${ascuList.ascu_id == param.ascu_id }">selected</c:if> value="${ascuList.ascu_id }">${ascuList.ascu_level }</option>
										</c:forEach>
										</c:otherwise>
									</c:choose>
								</select>
							<a href="#" class="button1"><span>기밀등급</span></a>&nbsp;&nbsp;
      							<!-- 기밀등급 -->
								<select name="asc_id" id="asc_id" class="selectBox" onchange="search_mridenty()" style="width: 80px;">
									<c:choose>
										<c:when test="${fn:length(requestScope.ascList)== 0}">
											<option selected="selected" value="0">0급비밀</option>
										</c:when>
										<c:otherwise>
											<c:forEach  var="ascList" items="${requestScope.ascList}" varStatus="status">
												<option <c:if test="${ascList.asc_id == param.asc_id }">selected</c:if> value="${ascList.asc_id }">${ascList.asc_level }</option>
											</c:forEach>
										</c:otherwise>
									</c:choose>
								</select>
      						</div>
							 --%>
							 <div class="align-left">
	      					 	<a href="#" class="button1"><span style="font-size: small;">평가 완료 / 전체 : ${requestScope.pyungCount } / ${fn:length(list)}</span></a>
	      					</div>
	      					<!-- 검색 -->
      						<div class="align-left" style="margin-left: 30px">
	      						<span style="width: 22px; height: 22px; background: url('img/icon-view-info.gif') no-repeat scroll right center transparent;  overflow: hidden;display:inline-block;"></span>
	      						<span style="vertical-align: top"><input name="searchText" type="text" id="searchText" style="width:140px;" value="${param.searchText }" /></span>
	      						<span><a href="#" class="button rightNoMargin verticTop" onclick="searchText('mridenty')"><span>조회</span></a></span>
      						</div>
	      					<div class="align-right"><!--select class="form-select"><option value="option1">Bulk Options</option>
	      					<option value="option2">Delete All</option></select-->
	                       			<a href="riskIAction.do?mode=exmridenty&searchText=${param.searchText }" class="button"><span>엑셀</span></a>
	                       			
	      					<c:choose>
	                       		<c:when test="${sessionScope.magamSession[2].state !='Y'}">
	                       		<!-- 마감 현황이 유무 판별(Y 시 입력 불가) -->
	                       			<a href="#" class="button" onclick="javascript: mridenty_insertPage()"><span>생성</span></a>
	      							<a href="#" class="button" onclick="javascript: riskIDelete()"><span>삭제</span></a>
	                       		</c:when>
	                       		<c:otherwise>
	                       			<a href="#" class="button1 addMargin" onclick="return false;"><span>생성</span></a>
	      							<a href="#" class="button1 addMargin" onclick="return false;"><span>삭제</span></a>
	                       		</c:otherwise>
	                       	</c:choose>
	      					</div>
	      				</td>
      				</tr>
      				<tr><td class="spaceLine"></td></tr>
      			</tfoot>
      		</table>
      		<form name="riskIDelForm" action="riskIAction.do" method="post">
        	<input type="hidden" name="mode" value="mridenty_delete"></input>
        	<input type="hidden" name="pro_id" value="${sessionScope.lastProId }"></input>
      		<table class="table-long">
      			<colgroup>
					<col width="45px"/>
					<col width="110px"/>
					<col/>
					<col width="110px"/>
					<col width="110px"/>
					<col/>
					<col width="15px"/>
				</colgroup>
      			<thead>
      				<tr>
      					<td class="col-chk"><input type='checkbox' name='checkAll' onclick="javascript: selectAll()" class="chkCursor"></input></td>
      					<td>위험코드</td>
      					<td>위험정의서 </td>
      					<td>자산명</td>
      					<td>위협명</td>
      					<td>취약성명</td>
      					<td></td>
      				</tr>
      			</thead>
      		</table>
      		<div class="scrollDIV">
      		<table class="table-long">
      			<colgroup>
					<col width="45px"/>
					<col width="110px"/>
					<col/>
					<col width="110px"/>
					<col width="110px"/>
					<col/>
					<col width="15px"/>
				</colgroup>
      			<tbody>
      				<c:choose>
                    	<c:when test="${fn:length(list)!= 0}">
                       	<c:forEach var="list" items="${requestScope.list}" varStatus="status">
                   			<%--
                   			<tr onmouseover="ChangeBackground(this,'over','${status.index}');" onmouseout="ChangeBackground(this,'out','${status.index}');" class="odd">
                   			 --%>
                   			 <tr <c:if test="${status.index%2==0 }">class="odd"</c:if> onmouseover="ChangeBackground(this,'over','${status.index}');" onmouseout="ChangeBackground(this,'out','${status.index}');">
                    			<td class="col-chk"><input type="checkbox" name="check" id="check${status.index+1 }"  class="chkCursor" value='${list.risk_id}'></input></td>
                    			<td>
                    			<!-- ie6에서 한글 깨짐 방지를 위한 전달 방법 -->
                    				<c:url var="url" value="riskIAction.do">
		                    				<c:param name="mode" value="mridenty_updatePage"/>
										    <c:param name="risk_id" value="${list.risk_id }"/>
										</c:url>
		                    				<div class="ellipsis"  style="width:100%;">
		                    				<a href="<c:out value="${url}"/>" class="nor ellipsis" title='${list.risk_id }'>${list.risk_id }</a>
		                    				</div>
                    			</td>
                    			<td>
                    				<div class="ellipsis"  style="width:100%;" title="${list.risk_nm }">${list.risk_nm }</div>
                    			</td>
                    			<td>
                    				<div class="ellipsis"  style="width:100%;" title="${list.raitem_nm}">${list.raitem_nm }</div>
                    			</td>
                    			<td>
                    				<div class="ellipsis"  style="width:100%;" title="${list.tk_nm3 }">${list.tk_nm3 }</div>
                    			</td>
                    			<td>
                    				<div class="ellipsis"  style="width:100%;" title="${list.v_nm }">${list.v_nm }</div>
                    			</td>
	   					 	<td></td>
                    		</tr>
                    	</c:forEach>
                    	</c:when>
                    	<c:otherwise>
                    		<tr class="odd">
								<td colspan="7"  class="noDataTD">-데이터가 없습니다-</td>
							</tr>
                    	</c:otherwise>
                    	</c:choose>
      			</tbody>
      		</table>  	
      		</div>
      		</form>
      	</div><!-- end of div.box-container1 -->
      	</div> <!-- end of div.box -->
</body>
</html>